﻿package  {
	import flash.display.MovieClip;
	import flash.display.Stage;
	import flash.events.Event;
	import Personagens.Exercitos;
	import Level.Level1;

	//classe principal do jogo Brazil Wars
	public class Main extends MovieClip {
		
		
		private var levelStage:String;
		private var LV_fase1:Level1;		

		private static var _instance : Main = null;		
		public var MC_tela:MovieClip;
		
		public static function getInstance():Main {
			return _instance;
		}		
		public static function getStage():Stage {
			return getInstance().stage;
		}
		
		public function Main() {
			_instance = this;
			iniciarJogo();			
		}
		
		public function iniciarJogo () : void {
			MC_tela = new HUD;
			addChild(MC_tela);
			levelStage = "Level1";
			LV_fase1 = new Level1();
			stage.addEventListener(Event.ENTER_FRAME,update, false, 0, true);
			desenharTela();
		}
		
		function update (e:Event) {
			switch (levelStage) {
				case "Level1":
					LV_fase1.update();
					break;
					
				case "Level2":
					break;
			}		
		}
		
		public function desenharTela() : void {
			switch (levelStage) {
				case "Level1":
					LV_fase1.desenharTela();
					break;
				
				case "Level2":
					break;
			}
		}
		
		
		
				
	}
	
}
